CDbl

Basic and Crystal syntax.

CDbl and ToNumber (numeric), ToNumber (string), ToNumber (Boolean) are equivalent functions.

Overloads
Arguments

CDbl (number or currency)

number or currency is a Number or Currency value or expression.

CDbl (string)

string is a String value or expression.

Returns

Number value

Action

CDbl returns a Number value created by converting the given Number, Currency or String type argument to a Number value. If the conversion cannot be done, an error occurs.

Examples

The following examples are applicable to both Basic and Crystal syntax:

CDbl ({Orders.Order Amount})

Returns the value of the Currency field {Orders.Order Amount} converted to Number type.

CDbl ("$120.20")

Returns the Number value of 120.2.

Comments

You can use the IsNumeric (str) or NumericText (str) function to check if the String argument can be converted to a Currency before doing the actual conversion. That way, if the conversion cannot be done, you can handle the situation appropriately.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com